package com.dragee.modules.work.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dragee.config.resolver.LongJsonDeserializer;
import com.dragee.config.resolver.LongJsonSerializer;
import com.dragee.modules.work.dto.TeamPerson;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 比赛裁判库
 * 
 * @author tc
 * @email tc@mail.com
 * @date 2023-05-05 14:31:54
 */
@Data
@TableName("t_competition_referee")
@NoArgsConstructor
public class CompetitionRefereeEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    public CompetitionRefereeEntity (TeamPerson t) {
        this.age = t.getAge();
        this.idCard = t.getIdCard();
        this.name = t.getName();
        this.tel = t.getTel();
        this.age = t.getAge();
    }

    /**
     * id
     */
    @TableId
    @JsonSerialize(using = LongJsonSerializer.class)
    @JsonDeserialize(using = LongJsonDeserializer.class)
    private Long id;

    /**
     * 比赛Id
     */
    private String competitionId;

    /**
     * 名字
     */
    private String name;

    /**
     * 电话
     */
    private String tel;

    /**
     * 身份证号
     */
    private String idCard;

    /**
     * 性别
     */
    private String sex;

    /**
     * 年龄
     */
    private String age;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 排序字段
     */
    @TableField(fill = FieldFill.INSERT)
    private Long sort;

    }